import { Action } from '@ngrx/store';
import { Basemap } from '../../models';

export enum BasemapActionTypes {
    LOAD_BASEMAPS = '[Basemaps] Load Basemap',
    LOAD_BASEMAPS_FAIL = '[Basemaps] Load Basemap Fail',
    LOAD_BASEMAPS_SUCCESS = '[Basemaps] Load Basemap Success',
    CHECKED_BASEMAPS = '[Basemap] Checked Basemap'
}

export class LoadBasemaps implements Action {
    readonly type = BasemapActionTypes.LOAD_BASEMAPS;
}

export class LoadBasemapsFail implements Action {
    readonly type = BasemapActionTypes.LOAD_BASEMAPS_FAIL;
    constructor(public payload: any) {}
}

export class LoadBasemapsSuccess implements Action {
    readonly type = BasemapActionTypes.LOAD_BASEMAPS_SUCCESS;
    constructor(public payload: Basemap[]) {}
}

export class CheckedBasemaps implements Action {
    readonly type = BasemapActionTypes.CHECKED_BASEMAPS;
    constructor(public payload: string) {}
}

export type BasemapAction
    = LoadBasemaps
    | LoadBasemapsFail
    | LoadBasemapsSuccess
    | CheckedBasemaps;